﻿using BCCommon;
using System;
using System.Collections.Generic;
using System.Text;

namespace BCTMSRESTful.Configs
{
    /// <summary>
    /// 芒果数据库配置
    /// </summary>
    public class MongoDBConfiguration:IMongoDBConfiguration
    {
        /// <summary>
        /// 数据库名称
        /// </summary>
        public string Database { get; }
        /// <summary>
        /// 链接字符串
        /// </summary>
        public string ConnectionString { get; }
        /// <summary>
        /// 服务器地址
        /// </summary>
        public string ServerAddress { get;  }
        /// <summary>
        /// 启用集群
        /// </summary>
        public string MongodbClusterEnabled { get; }
        /// <summary>
        /// 副本集名称
        /// </summary>
        public string ReplicaSetName { get;  }
        /// <summary>
        /// 超时时间
        /// </summary>
        public string TimeOut { get; }
        public MongoDBConfiguration(MongoDBOptions mongoDBOptions)
        {
            Database = mongoDBOptions.Database;
            ConnectionString = mongoDBOptions.ConnectionString;
            ServerAddress = mongoDBOptions.ServerAddress;
            MongodbClusterEnabled = mongoDBOptions.MongodbClusterEnabled;
            ReplicaSetName = mongoDBOptions.ReplicaSetName;
            TimeOut = mongoDBOptions.TimeOut;
        }

    }
}
